// models/RealtimeData.js
const Sequelize = require('sequelize');
const sequelize = require('../config/db').sequelize; // 导入数据库连接实例

const RealtimeData = sequelize.define('datainput', {
  ID: {
    type: Sequelize.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  DateTime: {
    type: Sequelize.STRING
  },
  Q: {
    type: Sequelize.DOUBLE
  },
  P: {
    type: Sequelize.DOUBLE
  },
  Ia: {
    type: Sequelize.DOUBLE
  },
  Ib: {
    type: Sequelize.DOUBLE
  },
  Ic: {
    type: Sequelize.DOUBLE
  },
  I2: {
    type: Sequelize.DOUBLE
  },
  Uab: {
    type: Sequelize.DOUBLE
  },
  Ubc: {
    type: Sequelize.DOUBLE
  },
  Uca: {
    type: Sequelize.DOUBLE
  },
  U0: {
    type: Sequelize.DOUBLE
  },
  Ifield: {
    type: Sequelize.DOUBLE
  },
  f: {
    type: Sequelize.DOUBLE
  },
  COSPHI: {
    type: Sequelize.DOUBLE
  },
  Ifh: {
    type: Sequelize.DOUBLE
  },
  Uf: {
    type: Sequelize.DOUBLE
  },
  Ifac: {
    type: Sequelize.DOUBLE
  },
  IH2CS001: {
    type: Sequelize.DOUBLE
  },
  IH2CS002: {
    type: Sequelize.DOUBLE
  },
  IH2CS003: {
    type: Sequelize.DOUBLE
  },
  IH2CS004: {
    type: Sequelize.DOUBLE
  },
  ISW2010: {
    type: Sequelize.DOUBLE
  },
  ISW2011: {
    type: Sequelize.DOUBLE
  },
  ISW2012: {
    type: Sequelize.DOUBLE
  },
  ISW2013: {
    type: Sequelize.DOUBLE
  },
  IH2S014: {
    type: Sequelize.DOUBLE
  },
  EWV1FA: {
    type: Sequelize.DOUBLE
  },
  EWV1FP: {
    type: Sequelize.DOUBLE
  }
}, {
  tableName: '大别山电厂一期datainputcorrect', // 指定数据库中的表名
  timestamps: false
});

module.exports = RealtimeData;
